package com.wanmait.computershop.util;
import com.alibaba.druid.pool.DruidDataSource;

public class DBHelper {
    private static DruidDataSource druidDataSource;
    public static DruidDataSource getDruidDataSource(){
        return druidDataSource;
    }
    static {
        druidDataSource = new DruidDataSource(); 
        
        druidDataSource.setDriverClassName("com.mysql.cj.jdbc.Driver");
        druidDataSource.setUrl("jdbc:mysql://database-1.cpeweeis2sdg.rds.cn-north-1.amazonaws.com.cn:3306/wm241017db2?serverTimezone=Asia/Shanghai&characterEncoding=utf-8");
        druidDataSource.setUsername("wm241017user2");
        druidDataSource.setPassword("wanmait_8C70O3");

        druidDataSource.setInitialSize(3);
        druidDataSource.setMinIdle(3);
        druidDataSource.setMaxActive(20);
        druidDataSource.setMaxWait(10000);
    }
}
